<?php

class syslogistics_api_dlvpoint_listById {

    public $apiDescription = "根据送货ID，获取多条送货点信息";

    public $use_strict_filter = true; // 是否严格过滤参数

    public function getParams()
    {
        $return['params'] = array(
            'id' =>['type'=>'string','valid'=>'required', 'description'=>'送货点ID,多条逗号隔开','default'=>'','example'=>'10'],
        );

        return $return;
    }

    public function get($params)
    {
        $objMdldlvpoint = app::get('syslogistics')->model('delivery_point');
        $dlvpointId = explode(',',$params['id']);
        $data = $objMdldlvpoint->getList('*', ['id'=>$dlvpointId]);
        foreach( $data as &$row  )
        {
            $row['area_id'] = $row['area'];
            $row['area']    = area::getSelectArea($row['area'],'');
        }
        return $data;
    }
}

